#include "syncup-service.h"
#include "syncup-service-glue.h"
#include <syncup.h>
#include <common.h>

#include <dbus/dbus-glib.h>


G_DEFINE_TYPE(SyncupService, syncup_service, G_TYPE_OBJECT)

static void
syncup_service_dispose(GObject *gobj)
{
    G_OBJECT_CLASS(syncup_service_parent_class)->dispose(gobj);
}

static void
syncup_service_finalize(GObject *gobj)
{
    G_OBJECT_CLASS(syncup_service_parent_class)->finalize(gobj);
}

static void
syncup_service_class_init(SyncupServiceClass *cls)
{
    GObjectClass *gobj_cls = G_OBJECT_CLASS(cls);
    gobj_cls->dispose = syncup_service_dispose;
    gobj_cls->finalize = syncup_service_finalize;
    dbus_g_object_type_install_info(SYNCUP_TYPE_SERVICE,
            &dbus_glib_syncup_service_object_info);
}

static void
syncup_service_init(SyncupService *self)
{
}

gboolean
syncup_service_label_path(SyncupService *obj, gchar *path, GError **err)
{
    g_debug("label path: %s", path);

    struct syncup_event *sc_evt = syncup_event_new(SC_EVENT_LABEL_PATH,
            strdup(path), (syncup_evt_hdlr_t) syncup_label_path, free);
    syncup_event_push(sc_evt);
    return TRUE;
}
